import Vue from 'vue'
import Vuex from 'vuex'
import {
  isLogin,getUserInfo
} from './utils/dataStorage'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLogin:isLogin(),
    user:getUserInfo()
  },
  mutations: {
    isLogin(state,flag){
      state.isLogin=flag
    },
    setUserInfo(state){
      state.user=getUserInfo()
    }
  },
  actions: {

  }
})
